package com.fjl.factoryBean;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

@Component("myService")
public class MyServiceFactoryBean implements FactoryBean<MyService> {

    @Override
    public MyService getObject() {
		System.out.println(11);
        return new MyService();  // 你可以在这里执行任何自定义初始化逻辑
    }

    @Override
    public Class<?> getObjectType() {
        return MyService.class;
    }

    @Override
    public boolean isSingleton() {
        return true; // 控制是否为单例
    }
}
